/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package android.app;

import android.graphics.Typeface;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.TextView;

/**
 *
 * @author efraingutierrez
 */
public class FontManager 
{
    
    public static void changeFont(ViewGroup view)
    {
        Typeface font = Typeface.createFromAsset(ContextoAndroid.context.getAssets(), "abril.ttf");
        for (int i = 0; i < view.getChildCount(); i++) 
        {
            View v = view.getChildAt(i);
            if (v instanceof EditText) 
            {
                ((EditText)v).setTypeface(font);
            } else if (v instanceof TextView) {
                ((TextView)v).setTypeface(font);
            } 
        }
    }
    
}
